home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / inpt15.zip / INPUT.DOC < prev    next >
Text File  |  1991-10-30  |  12KB  |  306 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.        
  8.        INPUT.EXE 1.5
  9.        Copyright 1991 by Chuck Steenburgh
  10.        
  11.           If you use batch files very often, you've probably acquired
  12.        a program called ASK.COM or QUERY.COM or something similar 
  13.        that allows you to ask questions and receive simple respones.
  14.        Usually, this involves typing an ECHO command with your
  15.        question, followed by ASK.COM or whatever.  If you do this
  16.        alot, you will probably appreciate the fact the INPUT.EXE
  17.        will accomplish the jobs of both the ECHO and ASK commands.
  18.        Add to this the greater flexibility that INPUT.EXE offers
  19.        in presenting your prompt to the user and in receiving input,
  20.        and you'll be sold.
  21.        
  22.        Usage: INPUT ["prompt"] [color] [/C] [/I] [/S] [/Y | /N] [/Pd] |
  23.        
  24.                  "prompt"        Enter the text you would like to
  25.                                  appear to prompt the user for
  26.                                  input.  This can be up to 59 char-
  27.                                  acters and must be enclosed in
  28.                                  quotation marks.
  29.        
  30.                  color           Enter a number representing the
  31.                                  color in which you want your mes-
  32.                                  sage to appear.  You must, of
  33.                                  course, have a color monitor and
  34.                                  card.  See Appendix 3.
  35.        
  36.                  /C              Include this switch if you want
  37.                                  your prompt message centered on
  38.                                  the current line.  If you include
  39.                                  this switch, you MUST include a
  40.                                  color value.
  41.                                  
  42.                  /I              Use this for a case-insensitive error
  43.                                  level return.  If this switch is
  44.                                  included on the command line, pressing
  45.                                  a letter a-z (lower case) will return
  46.                                  the same value as if the corresponding
  47.                                  key A-Z (upper case) were pressed.
  48.                                  
  49.                  /S              Show keypress.  Adding this switch
  50.                                  will cause INPUT to display the
  51.                                  errorlevel value returned.  Use this
  52.                                  for quick "debugging" of your use
  53.                                  of INPUT.EXE
  54.                                  
  55.                  /Y              Use this for a yes-no only response.  
  56.                                  If the "n" key is pressed, errorlevel 
  57.                                  of "0" is returned; pressing any other
  58.                                  key returns an errorlevel of 1.  The  
  59.                                  prompt "(Y/n)" is appended to the nor-
  60.                                  mal prompt specified by the user.     
  61.  
  62.                                      Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                                  
  69.                  /N              Use this for a yes-no only response.  
  70.                                  If the "y" key is pressed, errorlevel 
  71.                                  of "1" is returned; pressing any other
  72.                                  key returns an errorlevel of 0.  The  
  73.                                  prompt "(y/N)" is appended to the nor-
  74.                                  mal prompt specified by the user.     
  75.                                  This switch takes precedence over the 
  76.                                  /y switch.                            
  77.                                  
  78.                  /Pd             Pause 10 seconds for user input, then |
  79.                                  default to "d" (where "d" is any char-|
  80.                                  acter.  INPUT will wait up 10 seconds |
  81.                                  for user input.  If no key is pressed |
  82.                                  within 10 seconds, INPUT will act as  |
  83.                                  if the key specified by the key rep-  |
  84.                                  resented by the single character "d"  |
  85.                                  was pressed.  Note that all other     |
  86.                                  switches (case insensitivity, yes/no  |
  87.                                  answer, etc.) remain active if time   |
  88.                                  expires and the default key is used.  |
  89.                                  INPUT adds a warning that it will de- |
  90.                                  fault to the specified value after 10 |
  91.                                  seconds, and will display a succession|
  92.                                  of ten dots to indicate elapsed time. |
  93.                                  
  94.                  The command line parameters may be entered in any
  95.                  order, may be in any case, and may be preceded by 
  96.                  either the "/" or "-" character.     
  97.        
  98.        Examples:
  99.        
  100.             INPUT "Select a number from one to 10"
  101.        
  102.             This prints the text "Select on number from one to 10"
  103.        on the current line and waits for a keypress.
  104.        
  105.             INPUT "Press any key to continue" 79
  106.        
  107.             This prints the text "Press any key to continue" on the
  108.        current line in bright white on a red background and waits
  109.        for a keypress.
  110.        
  111.             INPUT "Press the space bar to exit" 143 /c
  112.        
  113.             This prints the text "Press the space bar to exit" cen-
  114.        tered on the current line in flashing bright white on a black
  115.        background.
  116.        
  117.             INPUT /s /i "Press any key..." /c 14
  118.             
  119.             Prompts user with "Press any key..." in yellow on black.
  120.        Returns a case-insensitive errorlevel and displays it on the
  121.        screen before terminating.
  122.  
  123.                                      Page 2
  124.  
  125.  
  126.  
  127.  
  128.  
  129.        
  130.             INPUT "Do you wish to continue?" /s 79 /y              
  131.             
  132.             Prompts user with "Do you wish to continue? (Y/n)" in 
  133.        white on red.  Returns errorlevel of 1 unless the "n" key is
  134.        pressed.  Displays errorlevel on screen.
  135.        
  136.             INPUT "Press any key..." /pf                               |
  137.             
  138.             Prompts user with "Press any key... (defaults to f after   |
  139.        10 seconds)" in black on white.  Returns errorlevel of 102 if   |
  140.        no key is pressed within 10 seconds, otherwise returns value of |
  141.        key pressed.
  142.        
  143.             INPUT "Press any key..." /c /pf                            |
  144.             
  145.             Prompts user with "Press any key... (defaults to f after   |
  146.        10 seconds)" in black on white.  Returns errorlevel of 70 if no |
  147.        key is pressed within 10 seconds, otherwise returns the upper   |
  148.        case ASCII value of the key pressed.                            |
  149.        
  150.           INPUT will also sound an alarm to let the user know that
  151.        a response is expected.
  152.        
  153.           When a key is pressed, INPUT will set the errorlevel equal
  154.        to the ASCII value of the key pressed.  This is slightly dif-
  155.        ferent from BATBOX in that in normal operation INPUT is case
  156.        sensitive and will allow you to distinguish between upper and
  157.        lower case letters.  If you want a case-insensitive return, use
  158.        the /i switch.  See Appendix 2 for a complete list of the ASCII
  159.        characters theoretically supported by INPUT.
  160.        
  161.           If you want greater control over the placement of your prompt
  162.        message on the screen, use WRITE in conjunction with INPUT.
  163.        Use WRITE to display your prompt then use INPUT without the
  164.        "prompt," color, or /c parameters.
  165.        
  166.        
  167.           INPUT is part of STEENBURGH'S STUFF Mildly Useful Utilities.
  168.        STEENBURGH'S STUFF includes the following programs:
  169.        
  170.             BATBOX:     Simple menu creation/inpu